package com.mes.schedule.manager;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.mes.schedule.domain.SOperationTask;
import com.mes.schedule.domain.ScheduleScheme;
import com.mes.schedule.manager.iface.IComingTaskManager;

@Component("comingTaskManager")
@Transactional
public class ComingTaskManager implements IComingTaskManager{

	 
	public void afterAssignTask(SOperationTask operationTask) throws Exception {
		// TODO Auto-generated method stub
		
	}

	 
	public void initComingTask(ScheduleScheme scheme) throws Exception {
		// TODO Auto-generated method stub
		
	}

//	 
//	public void afterAssignTask(SOperationTask operationTask)  throws Exception{
//		for(ResourceConstraint resourceConstraint:operationTask.getAlterResourceList())
//		{
//			resourceConstraint.getDevice().getComingTasks().remove(operationTask);
//		}
//		
//		
//
//	}
//
//	 
//	public void initComingTask(ScheduleScheme scheme)  throws Exception{
//		for (SDevice device : scheme.getDeviceMap().values()) {
//			device.getComingTasks().clear();
//		}
//		
//		for(SOperationTask operationTask:scheme.getAllOperationTaskMap().values())
//		{
//			if(operationTask.getControlStart().before(scheme.getWatchFinish()))
//			{
//				for(ResourceConstraint resourceConstraint:operationTask.getAlterResourceList())
//				{
//					resourceConstraint.getDevice().getComingTasks().add(operationTask);
//				}
//			}
//		}
//		
//	}

}
